 /**********************************************************************
 * Fichier : USBDriva.h
 *
 * Résumé : Fichier d'en-tête qui définit les variables globales et les
 *          fonctions usager du pilote.
 *
 * Auteur : Vincent Léger
 *
 * Dernière modification : Lundi 5 novembre 2012
 *
 **********************************************************************/
#ifndef _USBDRIVA_H_
#define _USBDRIVA_H_

 /******************************************
 *********DÉCLARATION DE LIBRAIRIES*********
 ******************************************/
#include "USBDrivaCore.h"         //fonctions "coeur" du pilote et structures personnelles
#include "MyIOCTL.h"            //définition des fonctions IOCTL
#include "DrivaDefinitions.h"
//Ces autres fichiers sont inclus par dépendance :
//#include "KernelLibz.h"         //librairies du kernel linux
//#include "DebugMacros.h"        //macros pour debogage
//#include "DriverDefinitions.h"  //définition des

 /******************************************
 ************VARIABLES GLOBALES*************
 ******************************************/
//struct class *ExBufClass;


 /******************************************
 *********DÉCLARATION DE FONCTIONS**********
 ******************************************/
//fonctions usager
int      USBDriva_init (void);
void     USBDriva_exit (void);
static int driva_probe(struct usb_interface *interface, const struct usb_device_id *id);
static void driva_disconnect(struct usb_interface *interface);
//ssize_t  USBDriva_read (struct file *flip, char __user *ubuf, size_t count, loff_t *f_ops);
//ssize_t  USBDriva_write (struct file *filp, const char __user *buf, size_t count, loff_t *f_pos);
//long     USBDriva_ioctl (struct file *flip, unsigned int cmd, unsigned long arg);


 /******************************************
 *****DÉCLARATION DES OPERATIONS USAGER*****
 ******************************************/
/*struct file_operations ExBuf_fops =
{
   .owner          =   THIS_MODULE,
   .open           =   USBDriva_open,
   .release        =   USBDriva_release,
   .read           =   USBDriva_read,
   .write          =   USBDriva_write,
   .unlocked_ioctl =   USBDriva_ioctl,
};*/
/*static struct usb_device_id driva_table [] = {
    { USB_DEVICE(DRIVA_VENDOR_ID, DRIVA_PROD_ID) },
    {   USB_DEVICE(vendor, product)
        USB_DEVICE_VER(vendor, product, lo, hi)
        USB_DEVICE_INFO(class, subclass, protocol)
        USB_INTERFACE_INFO(class, subclass, protocol)
    }
};*/

//note: will be needed soon enough
struct DrivaDevice {
	struct usb_device *	udev;			/* the usb device for this device */
	struct usb_interface *	interface;		/* the interface for this device */
	unsigned char *		bulk_in_buffer;		/* the buffer to receive data */
	size_t			bulk_in_size;		/* the size of the receive buffer */
	__u8			bulk_in_endpointAddr;	/* the address of the bulk in endpoint */
	__u8			bulk_out_endpointAddr;	/* the address of the bulk out endpoint */
	struct kref		kref;
};

static struct usb_device_id driva_table [] = {
    { USB_DEVICE(DRIVA_VENDOR_ID, DRIVA_PROD_ID) },
    { }
};
MODULE_DEVICE_TABLE (usb, driva_table);

struct usb_driver USBDriva =
{
    /*.owner      =   THIS_MODULE,*/
    .name       =   DRIVER_NAME,
    .id_table   =   driva_table,
    .probe      =   driva_probe,
    .disconnect =   driva_disconnect,
};


//installation/désinstallation du module

module_init(USBDriva_init);
module_exit(USBDriva_exit);


#endif  //_USBDRIVA_H_


